package game.web.entity;

import game.web.dao.ChargeDAO;
import game.web.dao.dto.ChargeDTO;
import game.web.dao.factory.ChargeFactory;

import java.util.List;

import projectx.core.base.ProjectXSystemException;
import projectx.core.base.ProjectXUserException;

public class ChargeEntityManager {

	public static boolean insert(ChargeDTO dto) throws ProjectXSystemException,
			ProjectXUserException {
		ChargeFactory factory = ChargeFactory.getFactory();
		ChargeDAO dao = factory.getChargeDAO();
		return dao.insert(dto);
	}

	public static List<ChargeDTO> listById(String userid) throws ProjectXSystemException,
			ProjectXUserException {
		ChargeFactory factory = ChargeFactory.getFactory();
		ChargeDAO dao = factory.getChargeDAO();
		return dao.listById(userid);
	}
	public static List<ChargeDTO> listByDate(String userid,String startdate,String enddate) throws ProjectXSystemException,
			ProjectXUserException {
		ChargeFactory factory = ChargeFactory.getFactory();
		ChargeDAO dao = factory.getChargeDAO();
		return dao.listByDate(userid,startdate,enddate);
	}
}
